home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_cyn_birdambients.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  156 lines

  1. # Jones 3D Cog Script
  2. #
  3. # CYN_BirdAmbients.cog
  4. #
  5. # Produces random ambient bird sounds.
  6. #
  7. # [CMG] [RT]
  8. #
  9. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14.     #..........................MESSAGES......................
  15.     message        startup
  16.     message        pulse
  17.     message        entered
  18.     message        user0
  19.     message        user3
  20.  
  21.     
  22.     #..........................COGS......................
  23.     cog            endscenecog
  24.     
  25.     #..........................ACTORS......................
  26.     thing        player                                    local
  27.  
  28.  
  29.     #..........................SOUNDS......................
  30.     sound        falcon=gen_canyon_a2.wav                local
  31.     sound        raven=gen_canyon_a3.wav                    local
  32.     sound        hawk=gen_canyon_a4.wav                    local
  33.     sound        crickets=olv_outside_a01.wav            local
  34.     sound        littlegrits=olv_outside_a02.wav            local
  35.     sound        tucan=olv_outside_a04.wav                local
  36.  
  37.  
  38.     #..........................SOUND THINGS......................
  39.     thing        sndObj00                                nolink
  40.     thing        sndObj01                                nolink
  41.     thing        sndObj02                                nolink
  42.     thing        sndObj03                                nolink
  43.     thing        sndObj04                                nolink
  44.     thing        sndObj05                                nolink
  45.  
  46.  
  47.     #..........................TRIGGERS......................
  48.     sector        on_sect00                                linkID=2 
  49.     sector        on_sect01                                linkID=2 
  50.  
  51.     sector        off_sect00                                linkID=3 
  52.     sector        off_sect01                                linkID=3 
  53.     
  54.     
  55.     #..........................VARIABLES......................
  56.     int            birdsong=1                                local
  57.     int            lastsong=0                                local
  58.     int            location                                local
  59.     int            killsound=0                                local
  60.     int            no_olv=0                                local
  61.  
  62. end
  63.  
  64. # ========================================================================================
  65. code
  66.  
  67. startup:
  68.  
  69.     player=GetLocalPlayerThing();
  70.     Sleep(18.0);    
  71.     PlaySoundLocal(hawk, 1, -1, 0, 0);
  72.     SetPulse(15.0);
  73.  
  74.     return;
  75.  
  76. # ========================================================================================
  77. pulse:
  78.  
  79.     if (killsound == 1) return;
  80.  
  81.  
  82.     SetPulse(RandBetween(8, 15));
  83.     
  84.     # check if indy is swimming, if so set the timer then drop out
  85.     if (GetMoveStatus(player) == 12) return;
  86.  
  87.     while(birdsong == lastsong)        # choose a sound
  88.     {
  89.         birdsong = RandBetween(1, 6);
  90.     }
  91.  
  92.     lastsong = birdsong;
  93.  
  94.     # choose a location for the sound
  95.     location = RandBetween(0, 5);
  96.     
  97.     if (birdsong == 1)
  98.         PlaySoundThing(hawk, sndObj00[location], 1, 40, 8, 0x0);
  99.         
  100.     else if (birdsong == 2)
  101.         PlaySoundThing(falcon, sndObj00[location], 1, 40, 8, 0x0);
  102.     
  103.     else if (birdsong == 3)
  104.         PlaySoundThing(raven, sndObj00[location], 1, 40, 8, 0x0);
  105.  
  106.     else if (birdsong == 4)  
  107.         {
  108.         if (no_olv == 1) return;
  109.         print("olv_outside_a01 would have played");
  110.         PlaySoundThing(crickets, sndObj00[location], 1, 40, 8, 0x0);
  111.         }
  112.         
  113.     else if (birdsong == 5)
  114.         PlaySoundThing(littlegrits, sndObj00[location], 1, 40, 8, 0x0);
  115.  
  116.     else if (birdsong == 6)
  117.         PlaySoundThing(tucan, sndObj00[location], 1, 40, 8, 0x0);
  118.     
  119.     
  120.     return;
  121.  
  122.  
  123. # ========================================================================================
  124. entered:
  125.  
  126. If (GetSourceRef() != player) return;
  127.  
  128.     If (GetSenderID() == 2)
  129.         {
  130.         SetPulse(8.0);
  131.         }
  132.  
  133.     If (GetSenderID() == 3)
  134.         {
  135.         SetPulse(0.0);
  136.         }
  137. return;
  138.     
  139. # ========================================================================================
  140. user0:
  141.     
  142.     if (GetSenderRef() != endscenecog) return;
  143.     
  144.     no_olv = 1;
  145.  
  146. return;
  147.  
  148. # ========================================================================================
  149. user3:
  150.  
  151.     killsound = 1;
  152.  
  153. return;
  154. # ========================================================================================
  155.  
  156. end